<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
    
        // keyup keydown 不区分大小写 a 和 A 都是65
        // document.addEventListener('keyup',function(e){
        //          console.log('up:'+e.keyCode);
        // })
        // keypress 区分大小写 a是97  A是65 
        document.addEventListener('keypress',function(e){
            console.log('press:'+e.key);
        })
    </script>
</body>
</html>